<?php

class home extends MY_Controller {

    
    
    public function __construct() 
    {
         parent::__construct();
         
    } 
    
    function index() {
//        $this->load->model('Menu_Model');
        //$data['menus'] = $this->data['menu'];
        
        $this->data['main_content'] = 'home';
        $this->load->view('includes/template', $this->data);

    }

    function validate_login()
    {		
            $this->load->model('Member_Model');
            $query = $this->Member_Model->validate();
            
            echo $query;
            if($query) // if the user's credentials validated...
            {
                    $data = array(
                            'username' => $this->input->post('username'),
                            'is_logged_in' => true
                    );
                    $this->session->set_userdata($data);
                    redirect('home');
            }
            else // incorrect username or password
            {
                redirect('home');
            }
    }	
    
    function logout(){
        $this->session->sess_destroy();
	redirect('home');
    }
        
    function signup() {
        $this->data['main_content'] = 'signup';
        $this->load->view('includes/template', $this->data);
    }
    
    function validate_signup(){
        
        $username = $this->input->post('signup_username');
        $password = $this->input->post('signup_password');
        $idcard = $this->input->post('signup_idcard');
        $firstname = $this->input->post('signup_firstname');
        $lastname = $this->input->post('signup_lastname');
        $address = $this->input->post('signup_address');
        $telephone = $this->input->post('signup_telephone');
        $emal = $this->input->post('signup_email');
        
    }

}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
